<%- include('../includes/head.ejs') %>
<link rel="stylesheet" href="/css/product.css"/>
</head>

<body>
<%- include('../includes/navigation.ejs') %>
<main>
<% if (products.length>0){ %>
    <ul>
        <% products.forEach(p=>{%>
            <li><%= p.productData.title%>(<%=p.qty %>)</li>
            <form action="/cart-delete-item" method="POST">
                <input type="hidden" value="<%= p.productData.id %>" name="productId">
                <button class="btn" type="submit">Delete</button>
            </form>
       <% })%>
    </ul>
    <%}else{ %>
    <h1>No Products in Cart!</h1>
    <%}%>
</main>
<%- include('../includes/end.ejs') %>
